package com.zxg.zbc.dal.dataobject;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class UserAlipayTrade {
  public static Integer      STATUS_NOT_PAY = 0;
  public static Integer      STATUS_PAYED   = 2;
  public final static String TABLE_NAME     = "user_alipay_trade";
  private Long               id;
  private Long               userId;
  private Long               payServiceId;
  private Integer            type;
  private String             alipayTradeId;
  private Integer            status;
  private String             tradeStatus;
  private String             receiveFee;
  private String             payAlipayId;
  private Boolean            processed;
  private String             buyerEmail;
  private Date               gmtModified;
  private Date               gmtCreated;

  
  private String alipayRequestUrl;
  
  public static Long generateId(Long userId) {
    String pre = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
    if (userId == null)
      userId = (long) new Random().nextInt(1000);
    String post = userId + "";
    if (post.length() > 4)
      post = post.substring(0, 4);
    String s = pre + post;
    try {
      return Long.parseLong(s);
    } catch (Exception e) {
      return null;
    }
  }
  public Long getId() {
    return id;
  }
  public void setId(Long id) {
    this.id = id;
  }
  public Long getUserId() {
    return userId;
  }
  public void setUserId(Long userId) {
    this.userId = userId;
  }
  public Long getPayServiceId() {
    return payServiceId;
  }
  public void setPayServiceId(Long payServiceId) {
    this.payServiceId = payServiceId;
  }
  public String getAlipayTradeId() {
    return alipayTradeId;
  }
  public void setAlipayTradeId(String alipayTradeId) {
    this.alipayTradeId = alipayTradeId;
  }
  public Integer getStatus() {
    return status;
  }
  public void setStatus(Integer status) {
    this.status = status;
  }
  public String getReceiveFee() {
    return receiveFee;
  }
  public void setReceiveFee(String receiveFee) {
    this.receiveFee = receiveFee;
  }
  public String getPayAlipayId() {
    return payAlipayId;
  }
  public void setPayAlipayId(String payAlipayId) {
    this.payAlipayId = payAlipayId;
  }
  public Boolean getProcessed() {
    return processed;
  }
  public void setProcessed(Boolean processed) {
    this.processed = processed;
  }
  public Date getGmtModified() {
    return gmtModified;
  }
  public String getGmtModifiedDisplay() {
    return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.gmtModified);
  }
  public void setGmtModified(Date gmtModified) {
    this.gmtModified = gmtModified;
  }
  public Date getGmtCreated() {
    return gmtCreated;
  }
  public void setGmtCreated(Date gmtCreated) {
    this.gmtCreated = gmtCreated;
  }
  public String getTradeStatus() {
    return tradeStatus;
  }
  public void setTradeStatus(String tradeStatus) {
    this.tradeStatus = tradeStatus;
  }
  public String getBuyerEmail() {
    return buyerEmail;
  }
  public void setBuyerEmail(String buyerEmail) {
    this.buyerEmail = buyerEmail;
  }

  public String getPayContent() {
    if (payServiceId == null)
      return "广告系统充值";
    return "广告系统充值";
  }
  public Integer getType() {
    return type;
  }
  public void setType(Integer type) {
    this.type = type;
  }
public String getAlipayRequestUrl() {
	return alipayRequestUrl;
}
public void setAlipayRequestUrl(String alipayRequestUrl) {
	this.alipayRequestUrl = alipayRequestUrl;
}

  
}
